﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SuperCalendar.Models;
using SuperCalendar.DataAccess;
using Google.GData;
using Google.GData.Calendar;
using System.Xml;
using System.IO;
using Google.GData.Extensions;
using Google.GData.Client;
using SuperCalendar;
using SuperCalendar.Models;
using SuperCalendar.DataAccess;
using SuperCalendar.Services;
using System.Xml.Linq;

namespace SuperCalendar.Test
{
    class Program
    {
        
        static int Main(string[] args)
        {

            //CalendarService service = new CalendarService("exampleCo-exampleApp-1");
            //service.setUserCredentials("matrixmaker@gmail.com", "y1123581321");

            //CalendarQuery query = new CalendarQuery();
            //query.Uri = new Uri("http://www.google.com/calendar/feeds/default/allcalendars/full");
            //CalendarFeed resultFeed = service.Query(query);
            //Console.WriteLine("Your calendars:\n");
            //foreach (CalendarEntry entry in resultFeed.Entries)
            //{
            //    Console.WriteLine(entry.Title.Text + "\n");
            //}
            //String feedUrl = "http://www.google.com/calendar/feeds/matrixmaker@gmail.com/private/full";
            //EventQuery myQuery = new EventQuery(feedUrl);
            //myQuery.StartTime = new DateTime(2008, 12, 1);
            //myQuery.EndTime = new DateTime(2009, 2, 1);
            //EventFeed myResultsFeed = service.Query(myQuery);
            //foreach (EventEntry e in myResultsFeed.Entries)
            //{

            //    Console.WriteLine(e.Id.AbsoluteUri+" "+e.Uid.Value);
            //}

            //Event e = new Event();
            //e.Priority = EventPriority.Height;
            //e.Title = "test";
            //e.Time = new EventTime(DateTime.Now, DateTime.Now.AddHours(2),false);

            //LocalCalendarService.Insert(e);

            //LocalCalendarService.Synchronize(new DateTime(2009,12,1),new DateTime(2009,1,30));

            XElement meta = new XElement("meta",
                                          new XElement("category", "unkown"),
                                          new XElement("priority",  EventPriority.High),
                                          new XElement("completed", 0));
            Console.WriteLine(meta.ToString());
           
            //Events.Insert(new Event());
            //Events.Save();

 

            return 0;
        }

    }
}
